package com.jzy.bean;

import com.jzy.constant.Status;
import com.jzy.util.DateUtils;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 姬海威 [haiwei.ji@tigermed.net]
 * @Date 2017-6-8 20:53
 */
@Data
public class DemoResponse<T> implements Serializable{

    private int code;
    private String msg;
    private T data;
    private Date timestamp = new Date();

    public DemoResponse() {
        this(Status.SUCCESS.getCode(),Status.SUCCESS.getMsg());
    }

    public DemoResponse(int code, String msg) {
        this(null, code, msg);
    }

    public DemoResponse(T data) {
        this(data, Status.SUCCESS.getCode(),Status.SUCCESS.getMsg());
    }

    public DemoResponse(T data, int code, String msg) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}
